#include <bits/stdc++.h>

using namespace std;

#define lson(x) ((x) << 1)
#define rson(x) ((x) << 1 | 1)

class Solution
{
public:
    typedef long long ll;
    static const int N = 50010, MOD = 1e9 + 7;

    struct Edge
    {
        int next, to;
    } edges[N];

    int head[N];
    int cnt = 0, idx = 0;

    struct Interval
    {
        int begin, end; // in[i]的子孙位于[begin,end]区间
    } in[N];

    struct SegTree
    {
        int l, r, lazy;
        ll sum;
    } tr[N << 2];

    vector<int> bonus(int n, vector<vector<int>> &leadership, vector<vector<int>> &operations)
    {
        // dfs一遍树，跑dfs序
        // 前向星
        memset(head, -1, sizeof(head));
        for (auto e : leadership)
        {
            add(e[0], e[1]);
        }
        dfs(1, 0);

        // 构造线段树
        build(1, 1, idx);
        vector<int> res;

        for (auto op : operations)
        {
            if (op[0] == 1)
            {
                int member = op[1], d = op[2];
                modify(1, in[member].begin, in[member].begin, d);
            }
            else if (op[0] == 2)
            {
                int member = op[1], d = op[2];
                modify(1, in[member].begin, in[member].end, d);
            }
            else
            {
                int member = op[1];
                res.push_back(query(1, in[member].begin, in[member].end));
            }
        }

        return res;
    }

    void add(int u, int v)
    {
        edges[cnt].to = v;
        edges[cnt].next = head[u];
        head[u] = cnt++;
    }

    void dfs(int u, int f)
    {
        in[u].begin = ++idx;
        for (int i = head[u]; ~i; i = edges[i].next)
        {
            int v = edges[i].to;
            if (v != f)
                dfs(v, u);
        }
        in[u].end = idx;
    }

    void pushup(int p)
    {

        tr[p].sum = (tr[ lson(p)].sum + tr[rson(p)].sum) % MOD;
    }

    void build(int cur, int l, int r)
    {
        tr[cur].l = l, tr[cur].r = r;
        if (l == r)
            return;

        int mid = (l + r) >> 1;
        build(lson(cur), l, mid);
        build(rson(cur), mid + 1, r);
        pushup(cur);
    }

    void pushdown(int p)
    {
        if (tr[p].lazy)
        {
            tr[lson(p)].sum = (tr[p].lazy * (tr[lson(p)].r - tr[lson(p)].l + 1) + tr[lson(p)].sum) % MOD;
            tr[rson(p)].sum = (tr[p].lazy * (tr[rson(p)].r - tr[rson(p)].l + 1) + tr[rson(p)].sum) % MOD;
            tr[lson(p)].lazy = (tr[lson(p)].lazy + tr[p].lazy) % MOD;
            tr[rson(p)].lazy = (tr[rson(p)].lazy + tr[p].lazy) % MOD;
            tr[p].lazy = 0;
        }
    }

    int query(int p, int l, int r)
    {
        if (tr[p].l >= l && tr[p].r <= r)
            return tr[p].sum % MOD;

        if (tr[p].l > r || tr[p].r < l)
            return 0;
        pushdown(p);
        return (query(lson(p), l, r) + query(rson(p), l, r)) % MOD;
    }

    void modify(int p, int l, int r, int d)
    {
        if (tr[p].l >= l && tr[p].r <= r)
        {
            tr[p].lazy = (tr[p].lazy + d) % MOD;
            tr[p].sum = (tr[p].sum + (tr[p].r - tr[p].l + 1) * d) % MOD;
            return;
        }

        if (tr[p].l > r || tr[p].r < l)
            return;

        pushdown(p);
        modify(lson(p), l, r, d);
        modify(rson(p), l, r, d);
        pushup(p);
    }
};

int main()
{
    vector<vector<int>> le;
    vector<vector<int>> op;
    int n, q;
    cin >> n >> q;

    for (int i = 1; i < n; i++)
    {
        vector<int> l(2);
        cin >> l[0] >> l[1];
        le.push_back(l);
    }

    while (q--)
    {
        vector<int> temp;
        int o0, o1, o2;
        cin >> o0;
        temp.push_back(o0);
        if (o0 != 3)
        {
            cin >> o1 >> o2;
            temp.push_back(o1);
            temp.push_back(o2);
        }
        else
        {
            cin >> o1;
            temp.push_back(o1);
        }
        op.push_back(temp);
    }

    Solution s;
    vector<int> res = s.bonus(n, le, op);
    for (auto a : res)
        cout << a << " ";

    cout << endl;
    return 0;
}

/*
6 5
1 2
1 6
2 3
2 5
1 4
1 1 500
2 2 50
3 1
2 6 15
3 1
*/